home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / em-xmkit.zip / EMM20_A.ASM < prev    next >
Assembly Source File  |  1989-11-29  |  5KB  |  95 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM20_A.ASM                                             ;
  3. ;                                                                             ;
  4. ;    FUNCTION NAME:   get_handle_name                                         ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function gets the eight-character name currently   ;
  7. ;                     assigned to a handle.  There is no restriction on the   ;
  8. ;                     characters which may be used in the handle name (that   ;
  9. ;                     is, anything from 00h through FFh).                     ;
  10. ;                                                                             ;
  11. ;                     The handle name is initialized to ASCII nulls (binary   ;
  12. ;                     zeros) at three times:  when the memory manager is      ;
  13. ;                     installed, when a handle is allocated, and when a       ;
  14. ;                     handle is deallocated.  By definition, a handle thus    ;
  15. ;                     initialized has no name.  To name a handle, you must    ;
  16. ;                     make at least one character in the name a non-null      ;
  17. ;                     character (to distinguish it from a handle without      ;
  18. ;                     a name.)                                                ;
  19. ;                                                                             ;
  20. ;           PASSED:   &handle_name:                                           ;
  21. ;                        is a far pointer to a structure into which the name  ;
  22. ;                        currently assigned to the handle will be copied.     ;
  23. ;                                                                             ;
  24. ;                     handle:                                                 ;
  25. ;                        is the handle for which the name is to be returned.  ;
  26. ;                                                                             ;
  27. ;         RETURNED:   status:                                                 ;
  28. ;                        is the status EMM returns from the call.  All other  ;
  29. ;                        returned results are valid only if the status        ;
  30. ;                        returned is zero.  Otherwise they are undefined.     ;
  31. ;                                                                             ;
  32. ;                     handle_name:                                            ;
  33. ;                        is the name currently assigned to the handle.  The   ;
  34. ;                        structure member is described here:                  ;
  35. ;                                                                             ;
  36. ;                        name:                                                ;
  37. ;                           is an array of chars that holds the handle's      ;
  38. ;                           name.                                             ;
  39. ;                                                                             ;
  40. ; C USE CONVENTION:   unsigned int       status;                              ;
  41. ;                     unsigned int       handle;                              ;
  42. ;                     HANDLE_NAME_STRUCT handle_name;                         ;
  43. ;                                                                             ;
  44. ;                     status = get_handle_name (&handle_name,                 ;
  45. ;                                               handle);                      ;
  46. ;-----------------------------------------------------------------------------;
  47. .XLIST
  48. PAGE    60,132
  49.  
  50. IFDEF SMALL
  51.    .MODEL SMALL, C
  52. ENDIF
  53. IFDEF MEDIUM
  54.    .MODEL MEDIUM, C
  55. ENDIF
  56. IFDEF LARGE
  57.    .MODEL LARGE, C
  58. ENDIF
  59. IFDEF COMPACT
  60.    .MODEL COMPACT, C
  61. ENDIF
  62. IFDEF HUGE
  63.    .MODEL HUGE, C
  64. ENDIF
  65.  
  66. INCLUDE emmlib.equ
  67. INCLUDE emmlib.str
  68. INCLUDE emmlib.mac
  69. .LIST
  70. .CODE
  71.  
  72. get_handle_name        PROC                                                  \
  73.             USES DI,                                              \
  74.             ptr_handle_name:FAR PTR BYTE,                             \
  75.             handle:WORD
  76.  
  77.     ;---------------------------------------------------------------------;
  78.     ;   do;                                                               ;
  79.     ;   .   get the current name of the specified handle;                 ;
  80.     ;---------------------------------------------------------------------;
  81.     MOVE        AX, get_handle_name_fcn
  82.     MOVE        DX, handle
  83.     MOVE        ES:DI, ptr_handle_name
  84.     INT         EMM_int
  85.  
  86.     ;---------------------------------------------------------------------;
  87.     ;   .   return (EMM status);                                          ;
  88.     ;   end;                                                              ;
  89.     ;---------------------------------------------------------------------;
  90.     RET_EMM_STAT    AH
  91.  
  92. get_handle_name        ENDP
  93.  
  94. END
  95.